package com.fishery.monitor.dao;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import com.fishery.monitor.mapper.WarningMapper;
import com.fishery.monitor.pojo.Equipment;
import com.fishery.monitor.pojo.MeteorologicalData;
import com.fishery.monitor.pojo.Warning;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 数据访问接口
 * @author Administrator
 *
 */
@Component
public class WarningDao {

    @Autowired
    WarningMapper warningMapper;

    public List<Warning> findAll(QueryWrapper<Warning> wrapper) {
        return  warningMapper.selectList(wrapper);
    }

    public IPage<Warning> findAll(Page<Warning> page, QueryWrapper<Warning> wrapper) {
        return warningMapper.selectPage(page,wrapper);
    }

    public void update(Warning warning) {
        this.warningMapper.updateById(warning);
    }

    public Warning findById(String id) {
        return (Warning)this.warningMapper.selectById(id);
    }
}
